#include<stdio.h>
#include<string.h>

//mycat cat xxx
int main(int argc, char* argv[])
{
  if(argc != 2)
  {
    printf("Usage: %s failname\n", argv[0]);
    return 1;
  }
  FILE* fp = fopen(argv[1], "r");
  if(fp == NULL)
  {
    perror("fopen()::fail\n");
    return 2;
  }
  while(1)
  {
    char buff[100] = {0};
    int n = fread(buff, 1, sizeof(buff) - 1, fp);
    if(n)
      printf("%s",buff);
   if(feof(fp)) break;
  }
  fclose(fp);
  return 0;
}
